<div class="problemindexholder" problemindex="A">
 <div class="ttypography">
  <div class="problem-statement">
   <div class="header">
    <div class="title">
     A. Curriculum Vitae
    </div>
    <div class="time-limit">
     <div class="property-title">
      time limit per test
     </div>
     1 second
    </div>
    <div class="memory-limit">
     <div class="property-title">
      memory limit per test
     </div>
     256 megabytes
    </div>
    <div class="input-file">
     <div class="property-title">
      input
     </div>
     standard input
    </div>
    <div class="output-file">
     <div class="property-title">
      output
     </div>
     standard output
    </div>
   </div>
   <div>
    <p>
     Hideo Kojima has just quit his job at Konami. Now he is going to find a new place to work. Despite being such a well-known person, he still needs a CV to apply for a job.
    </p>
    <p>
     During all his career Hideo has produced
     <span class="tex-span">
      <i>
       n
      </i>
     </span>
     games. Some of them were successful, some were not. Hideo wants to remove several of them (possibly zero) from his CV to make a better impression on employers. As a result there should be no unsuccessful game which comes right after successful one in his CV.
    </p>
    <p>
     More formally, you are given an array
     <span class="tex-span">
      <i>
       s
      </i>
      <sub class="lower-index">
       1
      </sub>
      ,
      <i>
       s
      </i>
      <sub class="lower-index">
       2
      </sub>
      , ...,
      <i>
       s
      </i>
      <sub class="lower-index">
       <i>
        n
       </i>
      </sub>
     </span>
     of zeros and ones. Zero corresponds to an unsuccessful game, one — to a successful one. Games are given in order they were produced, and Hideo can't swap these values. He should remove some elements from this array in such a way that no zero comes right after one.
    </p>
    <p>
     Besides that, Hideo still wants to mention as much games in his CV as possible. Help this genius of a man determine the maximum number of games he can leave in his CV.
    </p>
   </div>
   <div class="input-specification">
    <div class="section-title">
     Input
    </div>
    <p>
     The first line contains one integer number
     <span class="tex-span">
      <i>
       n
      </i>
     </span>
     (
     <span class="tex-span">
      1 ≤
      <i>
       n
      </i>
      ≤ 100
     </span>
     ).
    </p>
    <p>
     The second line contains
     <span class="tex-span">
      <i>
       n
      </i>
     </span>
     space-separated integer numbers
     <span class="tex-span">
      <i>
       s
      </i>
      <sub class="lower-index">
       1
      </sub>
      ,
      <i>
       s
      </i>
      <sub class="lower-index">
       2
      </sub>
      , ...,
      <i>
       s
      </i>
      <sub class="lower-index">
       <i>
        n
       </i>
      </sub>
     </span>
     (
     <span class="tex-span">
      0 ≤
      <i>
       s
      </i>
      <sub class="lower-index">
       <i>
        i
       </i>
      </sub>
      ≤ 1
     </span>
     ).
     <span class="tex-span">
      0
     </span>
     corresponds to an unsuccessful game,
     <span class="tex-span">
      1
     </span>
     — to a successful one.
    </p>
   </div>
   <div class="output-specification">
    <div class="section-title">
     Output
    </div>
    <p>
     Print one integer — the maximum number of games Hideo can leave in his CV so that no unsuccessful game comes after a successful one.
    </p>
   </div>
   <div class="sample-tests">
    <div class="section-title">
     Examples
    </div>
    <div class="sample-test">
     <div class="input">
      <div class="title">
       Input
      </div>
      <pre>4<br/>1 1 0 1<br/></pre>
     </div>
     <div class="output">
      <div class="title">
       Output
      </div>
      <pre>3<br/></pre>
     </div>
     <div class="input">
      <div class="title">
       Input
      </div>
      <pre>6<br/>0 1 0 0 1 0<br/></pre>
     </div>
     <div class="output">
      <div class="title">
       Output
      </div>
      <pre>4<br/></pre>
     </div>
     <div class="input">
      <div class="title">
       Input
      </div>
      <pre>1<br/>0<br/></pre>
     </div>
     <div class="output">
      <div class="title">
       Output
      </div>
      <pre>1<br/></pre>
     </div>
    </div>
   </div>
  </div>
  <p>
  </p>
 </div>
</div>
